package com.hck.infrastructure.redis;

import lombok.extern.slf4j.Slf4j;
import org.redisson.api.*;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Redisson服务空实现（当Redis禁用时使用）
 */
@Slf4j
@Service("redissonService")
@ConditionalOnProperty(name = "spring.redis.enabled", havingValue = "false", matchIfMissing = true)
public class NoOpRedissonService implements IRedisService {

    public <T> void setValue(String key, T value) {
        // 空实现
    }

    @Override
    public <T> void setValue(String key, T value, long expired) {
        // 空实现
    }

    public <T> T getValue(String key) {
        return null;
    }

    @Override
    public <T> RQueue<T> getQueue(String key) {
        return null;
    }

    @Override
    public <T> RBlockingQueue<T> getBlockingQueue(String key) {
        return null;
    }

    @Override
    public <T> RDelayedQueue<T> getDelayedQueue(RBlockingQueue<T> rBlockingQueue) {
        return null;
    }

    @Override
    public long incr(String key) {
        return 0;
    }

    @Override
    public long incrBy(String key, long delta) {
        return 0;
    }

    @Override
    public long decr(String key) {
        return 0;
    }

    @Override
    public long decrBy(String key, long delta) {
        return 0;
    }

    @Override
    public void remove(String key) {
        // 空实现
    }

    @Override
    public boolean isExists(String key) {
        return false;
    }

    public void addToSet(String key, String value) {
        // 空实现
    }

    public boolean isSetMember(String key, String value) {
        return false;
    }

    public void addToList(String key, String value) {
        // 空实现
    }

    public String getFromList(String key, int index) {
        return null;
    }

    public void addToMap(String key, String field, String value) {
        // 空实现
    }

    public String getFromMap(String key, String field) {
        return null;
    }

    public void addToSortedSet(String key, String value) {
        // 空实现
    }

    @Override
    public RLock getLock(String key) {
        return null;
    }

    @Override
    public RLock getFairLock(String key) {
        return null;
    }

    @Override
    public RReadWriteLock getReadWriteLock(String key) {
        return null;
    }

    @Override
    public RSemaphore getSemaphore(String key) {
        return null;
    }

    @Override
    public RPermitExpirableSemaphore getPermitExpirableSemaphore(String key) {
        return null;
    }

    @Override
    public RCountDownLatch getCountDownLatch(String key) {
        return null;
    }

    @Override
    public <T> RBloomFilter<T> getBloomFilter(String key) {
        return null;
    }
} 